MPEG encoders typically divide a video frame into macroblocks and blocks. Currently, as shown in FIG. 1, a macroblock 105 is a 16-by-16 set of pixels that can be divided into four blocks 110, which are each an 8-by-8 set of pixels. In some cases, the image within a macroblock can be represented by four 8-by-8 luminance blocks (i.e., one luminance block for each block 110) and two 8×8 chrominance blocks (where one chrominance block is a Cr color block, and the other chrominance block is a Cb color block). In other words, the image within a macroblock at times is represented by one luminance value for each pixel in the macroblock and 64 Cr values and 64 Cb values.
MPEG encoders typically perform motion estimation on a macroblock level, while performing DCT encoding on a block level. Such encoders either encode a macroblock as an interblock or an intrablock. Traditionally, an interblock is a motion compensated macroblock (i.e., it is a block that is defined by reference to past and/or future macroblocks), whereas an intrablock is coded as a brand new block (i.e., it is a block that is not defined by reference to past and/or future macroblocks). Newer intrablock encoding schemes allow a macroblock to be defined with respect to another block within the same frame.
MPEG encoders encode a macroblock as an intrablock if its energy value is less than its estimated error value as an interblock. Some prior encoders compute the macroblock's energy as the sum of the coefficient values of all pixels in the macroblock. This approach of prior encoders does not take into account the texture of the macroblocks that they are encoding, and this results in artifacts in the decoded image. Therefore, there is a need in the art for a video encoder that takes into account the texture of sections of video images that it is encoding in order to avoid artifacts in the decoded images.